<?php
define('IN_ECS', true);
require('../includes/init.php');
include_once('../comm.php');
include_once('log.php');


if(isset($_COOKIE['ECS'])){
		
}else{
	echo "<script>alert('您还没有登录！');location.href='../user.php';</script>";
	exit;
}


$userid = $_SESSION['user_id'];
$seid = $_COOKIE['ECS_ID'];
$sid = $_GET['sid'];
$w = 0;
$h = 0;
if(isset($_GET['sid'])){
	//ȡ��Ʒ���
	$sql = "select c.attr_name,b.attr_value from ".$ecs->table('goods')." a left join ".$ecs->table('goods_attr')." b on a.goods_id = b.goods_id left join ".$ecs->table('attribute')." c on b.attr_id = c.attr_id where a.goods_id = ".$sid;

	$row = $GLOBALS['db']->getAll($sql);

	foreach($row as $r){
		if($r['attr_name']=='width'){
			$w = $r['attr_value'];
		}
		if($r['attr_name']=='height'){
			$h = $r['attr_value'];
		}
	}
}

assign_template();

//echo var_dump($_COOKIE);exit;
//include_once('photoshop.html');
$smarty->assign('sid', $sid);
$smarty->assign('w', $w);
$smarty->assign('h', $h);
$smarty->assign('userid', $userid);
assign_dynamic('photoshop');
//var_dump($navigator_list['middle']);
$smarty->display('photoshop.dwt', null);
?>